package com.wendu.oa.dao.security;

import com.wendu.oa.dto.RoleDto;
import com.wendu.oa.model.Fun;
import com.wendu.oa.model.Role;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleDao {
    List<Role> findRoleList(RoleDto roleDto);

    @Delete("delete from t_rf where ro_id = #{ro_id}")
    void deleteRoleAllFuns(Integer ro_id);

    void insertRoleFuns(@Param("ro_id")Integer ro_id, @Param("f_ids")Integer[] f_ids);

    List<Fun> findFunList();

    @Select("select f_id from t_rf where ro_id = #{ro_id}")
    Integer[] findRoleFunIds(Integer ro_id);
}
